package top.zhangjianyong.blog.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Objects;

/**
 * @author zhangjianyong
 * @since 2025/8/7 09:24
 */
@AllArgsConstructor
@Getter
public enum FileType {
    BASE(0, "基础信息", "base"),
    BLOG(1, "博客", "blog"),
    WEIBO(2, "微博", "weibo");

    private final Integer type;
    private final String name;
    private final String rootPath;

    public static FileType getByType(Integer type) {
        if (type == null) return null;
        for (FileType value : FileType.values()) {
            if (Objects.equals(value.getType(), type)) {
                return value;
            }
        }
        return null;
    }

}
